package com.game.server.message.proto.execute;

import com.comm.ISession;
import com.game.majiang.config.DataManager;
import com.game.server.message.proto.in.AbstractVersionNumberReq;
import com.game.server.message.proto.out.VersionNumberRsp;
import lombok.extern.log4j.Log4j;


public class VersionNumberReq extends AbstractVersionNumberReq {

	@Override
	public void Execute(ISession session) {
		log.info("版本号");
		//        LogicClient client = (LogicClient) LogicServer.getInstance().getClient(session.getId());
		//        if (client != null) {
		//            // TODO Auto-generated method stub
		//        }
		VersionNumberRsp rsp = new VersionNumberRsp();

		String str = DataManager.getInstance().systemValue("versionNumber");
		Double d = Double.valueOf(str);
		Double newd = Double.valueOf(version);
		if(newd>=d){
			rsp.setIsok(1);
		}else{
			rsp.setIsok(0);
		}
		rsp.setShare(DataManager.getInstance().systemValue("shareurl"));
		session.send(rsp.Serialize());
	}

}
